<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ page trimDirectiveWhitespaces="true" %>
<!DOCTYPE html>
<html lang="zh-cmn-Hans" >
    <head >
     <title>找回密码</title>
     <meta charset='utf-8' itemprop="encoding" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <%@ include file="/WEB-INF/views/jsp/includes/headerjs.jsp"%>
  </head>
  <body  class="no-skin">
<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>
			<div class="main-content">
				<div class="main-content-inner tabs-container">
					<div class="page-content" >
						<div class="row login-box visible widget-box no-border col-center-block">
							<div class="widget-body">
								<div id="self-password-page-content-div" class="widget-main" >
								   <div class="col-center-block"  style="margin-top: 5px;width: 400px">
								  		 <form action="${ctx}/auth/password/reset/${token}" class="form-horizontal editForm " method="post" role="form">
								  		  <div class="alert alert-danger hide alert-dismissable" role="alert">
											<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
												<i class="ace-icon fa fa-times"></i>
											</button>
											<strong>
											<i class="ace-icon fa fa-times"></i><span class="editForm-msg-head"></span></strong>
											<span class="editForm-msg"></span>
											<br />
										</div>
										<input type="hidden" valid="true" name="password">
								  		 <div class="profile-user-info profile-user-info-striped ">
												  <div class="profile-info-row">
													<div class="profile-info-name">密码:</div>
													<div class="profile-info-value">
														<input type="password" oldval=""  placeholder="密码" class="validate[required,maxSize[20]] newPassword1" />
													</div>
												 </div>
												 <div class="profile-info-row">
													<div class="profile-info-name">再次输入密码:</div>
													<div class="profile-info-value">
														<input type="password" oldval="" targetname="password" placeholder="再次输入密码" class="validate[required,maxSize[20],equals[.newPassword1]] password" />
													</div>
												 </div>
								  		 </div>
								  		   <div class="space"></div>
					                      <div class="clearfix">
												<button type="reset" class="width-30 pull-left btn btn-sm btn-info">
													<i class="ace-icon fa fa-refresh"></i>
													<span class="bigger-110">重置</span>
												</button>
			
												<button type="submit" id="but_login" class="width-35 pull-right btn btn-sm btn-primary">
													<span class="bigger-110">保存</span>
			
													<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
												</button>
											</div>
										  </form>
								  	 </div>
								</div><!-- #dialog-message -->
						    </div>
						</div>
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->
			<div class="footer">
	<div class="footer-inner">
		<div class="footer-content">
			<span class="bigger-120">
				<span class="blue bolder">${copyright}</span>
				    Copyright &copy; 2016
			</span>
		</div>
	</div>
</div>
 </div>
<%@ include file="/WEB-INF/views/jsp/includes/footerjs_simple.jsp"%>
<script type="text/javascript" src="${plugin}/crypt/cryptoJS/components/core.js"></script>
<script type="text/javascript" src="${plugin}/crypt/cryptoJS/components/md5.js"></script>
<script type="text/javascript" src="${plugin}/crypt/cryptoJS/rollups/aes.js"></script>
<script type="text/javascript" src="${plugin}/crypt/cryptoJS/components/pad-iso10126-min.js"></script>
 <script type="text/javascript">
var aesKey = "${sessionScope.id}"; 
$(function() {
    $("form").validationEngine('attach', {promptPosition : "topRight", autoPositionUpdate : true});
    $("form .password").on("keyup change",function(e){
 	   var value = $(this).val();
 	   var form = $(this).closest("form")
 	   var targetname = $(this).attr("targetname");
 	   var val = "";
 	   val = encryptByAes(value,aesKey);
 	   $(form.find("input[name='"+targetname+"']").get(0)).val(val);
     }); 
});
/**
 * 加密数据
 * @param {type} message 待加密的字符串
 * @param {type} key 秘钥
 * @returns {unresolved} 加密后的数据
 */
function encryptByAes(message, key) {
	var sendData = CryptoJS.enc.Utf8.parse(message);
    var key = CryptoJS.MD5(key);
    var encrypted = CryptoJS.AES.encrypt(sendData, key,{iv:key,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Iso10126});
    return encrypted.toString();
} 
</script>
  </body>
</html>
